<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AIfES 2: aialgo_sequential_inference.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="AIfES_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AIfES 2
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('aialgo__sequential__inference_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">aialgo_sequential_inference.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Functions required for inference of models.  
<a href="#details">More...</a></p>

<p><a href="aialgo__sequential__inference_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a877ce6eee19a9f9bcbdb115d83537e68"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a877ce6eee19a9f9bcbdb115d83537e68">aialgo_sizeof_inference_memory</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model)</td></tr>
<tr class="memdesc:a877ce6eee19a9f9bcbdb115d83537e68"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the memory requirements for intermediate results of an inference.  <a href="aialgo__sequential__inference_8h.html#a877ce6eee19a9f9bcbdb115d83537e68">More...</a><br /></td></tr>
<tr class="separator:a877ce6eee19a9f9bcbdb115d83537e68"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acdf3763b8fe9047446ddbcfdbdae5570"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#acdf3763b8fe9047446ddbcfdbdae5570">aialgo_sizeof_parameter_memory</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model)</td></tr>
<tr class="memdesc:acdf3763b8fe9047446ddbcfdbdae5570"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the memory requirements for the trainable parameters (like weights, bias, ...) of the model.  <a href="aialgo__sequential__inference_8h.html#acdf3763b8fe9047446ddbcfdbdae5570">More...</a><br /></td></tr>
<tr class="separator:acdf3763b8fe9047446ddbcfdbdae5570"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7cbfac6a46c02107d19af7c8f6e5469a"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a7cbfac6a46c02107d19af7c8f6e5469a">aialgo_schedule_inference_memory</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model, void *memory_ptr, uint32_t memory_size)</td></tr>
<tr class="memdesc:a7cbfac6a46c02107d19af7c8f6e5469a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assign the memory for intermediate results of an inference to the model.  <a href="aialgo__sequential__inference_8h.html#a7cbfac6a46c02107d19af7c8f6e5469a">More...</a><br /></td></tr>
<tr class="separator:a7cbfac6a46c02107d19af7c8f6e5469a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26db68cb4231b534b03c649d6eeab3f8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a26db68cb4231b534b03c649d6eeab3f8">aialgo_distribute_parameter_memory</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model, void *memory_ptr, uint32_t memory_size)</td></tr>
<tr class="memdesc:a26db68cb4231b534b03c649d6eeab3f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assign the memory for the trainable parameters (like weights, bias, ...) of the model.  <a href="aialgo__sequential__inference_8h.html#a26db68cb4231b534b03c649d6eeab3f8">More...</a><br /></td></tr>
<tr class="separator:a26db68cb4231b534b03c649d6eeab3f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4655caab3051cc837312c286fbe4789a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a4655caab3051cc837312c286fbe4789a">aialgo_forward_model</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model, <a class="el" href="structaitensor.html">aitensor_t</a> *input_data)</td></tr>
<tr class="memdesc:a4655caab3051cc837312c286fbe4789a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform a forward pass on the model.  <a href="aialgo__sequential__inference_8h.html#a4655caab3051cc837312c286fbe4789a">More...</a><br /></td></tr>
<tr class="separator:a4655caab3051cc837312c286fbe4789a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a295cb2bb6c3fefc478042f66e067e090"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a295cb2bb6c3fefc478042f66e067e090">aialgo_inference_model</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model, <a class="el" href="structaitensor.html">aitensor_t</a> *input_data, <a class="el" href="structaitensor.html">aitensor_t</a> *output_data)</td></tr>
<tr class="memdesc:a295cb2bb6c3fefc478042f66e067e090"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform an inference on the model / Run the model.  <a href="aialgo__sequential__inference_8h.html#a295cb2bb6c3fefc478042f66e067e090">More...</a><br /></td></tr>
<tr class="separator:a295cb2bb6c3fefc478042f66e067e090"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3fb665166082f1e7a89e23218a105ce8"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a3fb665166082f1e7a89e23218a105ce8">aialgo_compile_model</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model)</td></tr>
<tr class="memdesc:a3fb665166082f1e7a89e23218a105ce8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the model structure.  <a href="aialgo__sequential__inference_8h.html#a3fb665166082f1e7a89e23218a105ce8">More...</a><br /></td></tr>
<tr class="separator:a3fb665166082f1e7a89e23218a105ce8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a07f280b3565ec1b02f00d907a2834940"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a07f280b3565ec1b02f00d907a2834940">aialgo_quantize_model_f32_to_q7</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model_f32, <a class="el" href="structaimodel.html">aimodel_t</a> *model_q7, <a class="el" href="structaitensor.html">aitensor_t</a> *representative_dataset)</td></tr>
<tr class="memdesc:a07f280b3565ec1b02f00d907a2834940"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quantize model parameters (weights and bias)  <a href="aialgo__sequential__inference_8h.html#a07f280b3565ec1b02f00d907a2834940">More...</a><br /></td></tr>
<tr class="separator:a07f280b3565ec1b02f00d907a2834940"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b1aae54861650b0d6e80fc638a0b0ea"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a0b1aae54861650b0d6e80fc638a0b0ea">aialgo_set_model_result_precision_q31</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model, uint16_t shift)</td></tr>
<tr class="memdesc:a0b1aae54861650b0d6e80fc638a0b0ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the quantization parameters of the layer results for <a class="el" href="aimath__q31_8h.html">Q31 </a> data type.  <a href="aialgo__sequential__inference_8h.html#a0b1aae54861650b0d6e80fc638a0b0ea">More...</a><br /></td></tr>
<tr class="separator:a0b1aae54861650b0d6e80fc638a0b0ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d70260b376741a0cef4c42d41e705f8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a4d70260b376741a0cef4c42d41e705f8">aialgo_set_model_delta_precision_q31</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model, uint16_t shift)</td></tr>
<tr class="memdesc:a4d70260b376741a0cef4c42d41e705f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the quantization parameters of the layer deltas for <a class="el" href="aimath__q31_8h.html">Q31 </a> data type.  <a href="aialgo__sequential__inference_8h.html#a4d70260b376741a0cef4c42d41e705f8">More...</a><br /></td></tr>
<tr class="separator:a4d70260b376741a0cef4c42d41e705f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a436e4f31e3a5498d033917db8277ff55"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a436e4f31e3a5498d033917db8277ff55">aialgo_set_model_gradient_precision_q31</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model, uint16_t shift)</td></tr>
<tr class="memdesc:a436e4f31e3a5498d033917db8277ff55"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the quantization parameters of the gradients for <a class="el" href="aimath__q31_8h.html">Q31 </a> data type.  <a href="aialgo__sequential__inference_8h.html#a436e4f31e3a5498d033917db8277ff55">More...</a><br /></td></tr>
<tr class="separator:a436e4f31e3a5498d033917db8277ff55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bb5fdb556c51ad8b3043d220f0a1276"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a3bb5fdb556c51ad8b3043d220f0a1276">aialgo_print_model_structure</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model)</td></tr>
<tr class="memdesc:a3bb5fdb556c51ad8b3043d220f0a1276"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print the layer structure of the model with the configured parameters.  <a href="aialgo__sequential__inference_8h.html#a3bb5fdb556c51ad8b3043d220f0a1276">More...</a><br /></td></tr>
<tr class="separator:a3bb5fdb556c51ad8b3043d220f0a1276"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3beb79c952cd2f86574f3608b09ebbf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#af3beb79c952cd2f86574f3608b09ebbf">aialgo_set_layer_settings_model</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model, uint32_t bitmask, uint8_t shift, uint32_t value)</td></tr>
<tr class="memdesc:af3beb79c952cd2f86574f3608b09ebbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Apply the specified setting to all layers in the model.  <a href="aialgo__sequential__inference_8h.html#af3beb79c952cd2f86574f3608b09ebbf">More...</a><br /></td></tr>
<tr class="separator:af3beb79c952cd2f86574f3608b09ebbf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d3943ef443b70a282c8af18b1155a2c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a2d3943ef443b70a282c8af18b1155a2c">aialgo_set_training_mode_model</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model, uint8_t value)</td></tr>
<tr class="memdesc:a2d3943ef443b70a282c8af18b1155a2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables / disables the training mode of the model.  <a href="aialgo__sequential__inference_8h.html#a2d3943ef443b70a282c8af18b1155a2c">More...</a><br /></td></tr>
<tr class="separator:a2d3943ef443b70a282c8af18b1155a2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a364f7453327a3f2b734cae035fb31aa7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a364f7453327a3f2b734cae035fb31aa7">aialgo_set_batch_mode_model</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model, uint8_t value)</td></tr>
<tr class="memdesc:a364f7453327a3f2b734cae035fb31aa7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables / disables the batch mode of the model.  <a href="aialgo__sequential__inference_8h.html#a364f7453327a3f2b734cae035fb31aa7">More...</a><br /></td></tr>
<tr class="separator:a364f7453327a3f2b734cae035fb31aa7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a46374a6a778c3fdeb43e7f32c7f5a2a5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aialgo__sequential__inference_8h.html#a46374a6a778c3fdeb43e7f32c7f5a2a5">aialgo_set_trainable_model</a> (<a class="el" href="structaimodel.html">aimodel_t</a> *model, uint8_t value)</td></tr>
<tr class="memdesc:a46374a6a778c3fdeb43e7f32c7f5a2a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Freeze / Unfreeze trainable parameters of the model.  <a href="aialgo__sequential__inference_8h.html#a46374a6a778c3fdeb43e7f32c7f5a2a5">More...</a><br /></td></tr>
<tr class="separator:a46374a6a778c3fdeb43e7f32c7f5a2a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Functions required for inference of models. </p>
<dl class="section version"><dt>Version</dt><dd>2.2.0 </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2020-2023 Fraunhofer Institute for Microelectronic Circuits and Systems. All rights reserved.<br  />
<br  />
 AIfES is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<br  />
<br  />
 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.<br  />
<br  />
 You should have received a copy of the GNU Affero General Public License along with this program. If not, see <a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>.</dd></dl>
<p>The functions target memory allocation/scheduling, the calculation of the forward pass and quantization for model inference </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a3fb665166082f1e7a89e23218a105ce8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3fb665166082f1e7a89e23218a105ce8">&#9670;&nbsp;</a></span>aialgo_compile_model()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t aialgo_compile_model </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the model structure. </p>
<p>Counts the number of layers and trainable parameters in a model as preparation for inference or training.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful </dd></dl>

</div>
</div>
<a id="a26db68cb4231b534b03c649d6eeab3f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a26db68cb4231b534b03c649d6eeab3f8">&#9670;&nbsp;</a></span>aialgo_distribute_parameter_memory()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aialgo_distribute_parameter_memory </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>memory_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>memory_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Assign the memory for the trainable parameters (like weights, bias, ...) of the model. </p>
<p>Only use this function if the parameters are not pre-trained or manually configured. Afterwards an initialization of the memory (for example by initializing the weights) has to be performed.</p>
<p>The required memory size can be calculated with <a class="el" href="aialgo__sequential__inference_8h.html#acdf3763b8fe9047446ddbcfdbdae5570" title="Calculate the memory requirements for the trainable parameters (like weights, bias,...">aialgo_sizeof_parameter_memory()</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
    <tr><td class="paramname">*memory_ptr</td><td>Pointer to the memory block </td></tr>
    <tr><td class="paramname">memory_size</td><td>Size of the memory block (for error checking) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful </dd></dl>

</div>
</div>
<a id="a4655caab3051cc837312c286fbe4789a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4655caab3051cc837312c286fbe4789a">&#9670;&nbsp;</a></span>aialgo_forward_model()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structaitensor.html">aitensor_t</a>* aialgo_forward_model </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>input_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Perform a forward pass on the model. </p>
<p>The result is stored in the result tensor of the output layer and a pointer to this is returned. This output result is stored in the inference memory and is only valid as long as the inference memory is valid. To get the output as a separate tensor, use <a class="el" href="aialgo__sequential__inference_8h.html#a295cb2bb6c3fefc478042f66e067e090" title="Perform an inference on the model / Run the model.">aialgo_inference_model()</a> instead.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
    <tr><td class="paramname">*input_data</td><td>Input data tensor of the same shape as the input_layer shape </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer to the output data of the forward pass (points to the result tensor of the output layer) </dd></dl>

</div>
</div>
<a id="a295cb2bb6c3fefc478042f66e067e090"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a295cb2bb6c3fefc478042f66e067e090">&#9670;&nbsp;</a></span>aialgo_inference_model()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t aialgo_inference_model </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>input_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>output_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Perform an inference on the model / Run the model. </p>
<p>Make shure to initialize the model (<a class="el" href="aialgo__sequential__inference_8h.html#a3fb665166082f1e7a89e23218a105ce8" title="Initialize the model structure.">aialgo_compile_model()</a>) and schedule the inference memory (for example with <a class="el" href="aialgo__sequential__inference_8h.html#a7cbfac6a46c02107d19af7c8f6e5469a" title="Assign the memory for intermediate results of an inference to the model.">aialgo_schedule_inference_memory()</a> or <a class="el" href="aialgo__sequential__training_8h.html#aa6ae098c2add3651d216724f102e931b" title="Assign the memory for model training.">aialgo_schedule_training_memory()</a>) before calling this function.</p>
<p>Example: </p><div class="fragment"><div class="line"><span class="keywordtype">float</span> input_data[] = {0.0f, 1.0f, 0.0f};</div>
<div class="line">uint16_t input_shape[] = {1, 3}</div>
<div class="line"><a class="code" href="structaitensor.html">aitensor_t</a> input_tensor = AITENSOR_2D_F32(input_shape, input_data);</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span> output_data[2];</div>
<div class="line">uint16_t output_shape[] = {1, 2}</div>
<div class="line"><a class="code" href="structaitensor.html">aitensor_t</a> output_tensor = AITENSOR_2D_F32(output_shape, output_data);</div>
<div class="line"> </div>
<div class="line"><a class="code" href="aialgo__sequential__inference_8h.html#a295cb2bb6c3fefc478042f66e067e090">aialgo_inference_model</a>(&amp;model, &amp;input_tensor, &amp;output_tensor);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// The results are now in the output_tensor</span></div>
<div class="ttc" id="aaialgo__sequential__inference_8h_html_a295cb2bb6c3fefc478042f66e067e090"><div class="ttname"><a href="aialgo__sequential__inference_8h.html#a295cb2bb6c3fefc478042f66e067e090">aialgo_inference_model</a></div><div class="ttdeci">uint8_t aialgo_inference_model(aimodel_t *model, aitensor_t *input_data, aitensor_t *output_data)</div><div class="ttdoc">Perform an inference on the model / Run the model.</div></div>
<div class="ttc" id="astructaitensor_html"><div class="ttname"><a href="structaitensor.html">aitensor</a></div><div class="ttdoc">A tensor in AIfES.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:89</div></div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
    <tr><td class="paramname">*input_data</td><td>Input data tensor of the same shape as the input_layer shape </td></tr>
    <tr><td class="paramname">*output_data</td><td>Empty tensor for the results of the inference with the size of your outputs </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful </dd></dl>

</div>
</div>
<a id="a3bb5fdb556c51ad8b3043d220f0a1276"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3bb5fdb556c51ad8b3043d220f0a1276">&#9670;&nbsp;</a></span>aialgo_print_model_structure()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aialgo_print_model_structure </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Print the layer structure of the model with the configured parameters. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a07f280b3565ec1b02f00d907a2834940"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a07f280b3565ec1b02f00d907a2834940">&#9670;&nbsp;</a></span>aialgo_quantize_model_f32_to_q7()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aialgo_quantize_model_f32_to_q7 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model_f32</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model_q7</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>representative_dataset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Quantize model parameters (weights and bias) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model_f32</td><td>Pointer to model with single-precision floating point parameters that should be quantized </td></tr>
    <tr><td class="paramname">*model_q7</td><td>Pointer to model with quantized, fixed-point parameters in q7 format </td></tr>
    <tr><td class="paramname">*representative_dataset</td><td>Pointer to a dataset that represents real model inputs to determine fixed-point quantization parameters </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a7cbfac6a46c02107d19af7c8f6e5469a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7cbfac6a46c02107d19af7c8f6e5469a">&#9670;&nbsp;</a></span>aialgo_schedule_inference_memory()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t aialgo_schedule_inference_memory </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>memory_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>memory_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Assign the memory for intermediate results of an inference to the model. </p>
<p>The required memory size can be calculated with <a class="el" href="aialgo__sequential__inference_8h.html#a877ce6eee19a9f9bcbdb115d83537e68" title="Calculate the memory requirements for intermediate results of an inference.">aialgo_sizeof_inference_memory()</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
    <tr><td class="paramname">*memory_ptr</td><td>Pointer to the memory block </td></tr>
    <tr><td class="paramname">memory_size</td><td>Size of the memory block (for error checking) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if successful </dd></dl>

</div>
</div>
<a id="a364f7453327a3f2b734cae035fb31aa7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a364f7453327a3f2b734cae035fb31aa7">&#9670;&nbsp;</a></span>aialgo_set_batch_mode_model()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aialgo_set_batch_mode_model </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables / disables the batch mode of the model. </p>
<p>When executed in batch mode, a whole batch is processed by one forward pass.<br  />
Some layers may behave differently during training than during inference (e.g. the Batch Normalization layer).<br  />
The <a class="el" href="aialgo__sequential__training_8h.html#a6557fccf302f653bcdcb77830463d14d" title="Perform one training epoch on all data batches of the dataset using backpropagation.">aialgo_train_model()</a> function calls this function internally (Batch mode gets enabled if the batch_size equals the first element of the <a class="el" href="structailayer__input.html#a783daa03ac67ce4a58f74b1d3ad1f787" title="Shape of the input tensor.">ailayer_input.input_shape</a> and gets disabled otherwise).</p>
<p>The setting value can be accessed with: </p><div class="fragment"><div class="line"><span class="keywordflow">if</span>(AILAYER_SETTINGS_IS(layer-&gt;settings, 0b1, AILAYER_SETTINGS_BATCH_MODE)){</div>
<div class="line">  ...</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
    <tr><td class="paramname">value</td><td>Target value (TRUE or FALSE) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af3beb79c952cd2f86574f3608b09ebbf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3beb79c952cd2f86574f3608b09ebbf">&#9670;&nbsp;</a></span>aialgo_set_layer_settings_model()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aialgo_set_layer_settings_model </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>bitmask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>shift</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Apply the specified setting to all layers in the model. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
    <tr><td class="paramname">bitmask</td><td>32-bit mask to address the setting value (usually set to 0b1) </td></tr>
    <tr><td class="paramname">shift</td><td>The amount of bits to shift the bitmask to address the desired setting value (e.g. AILAYER_SETTINGS_TRAINING_MODE) </td></tr>
    <tr><td class="paramname">value</td><td>The target value </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a4d70260b376741a0cef4c42d41e705f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4d70260b376741a0cef4c42d41e705f8">&#9670;&nbsp;</a></span>aialgo_set_model_delta_precision_q31()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aialgo_set_model_delta_precision_q31 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>shift</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the quantization parameters of the layer deltas for <a class="el" href="aimath__q31_8h.html">Q31 </a> data type. </p>
<p>Initializes the quantization parameters of the layer deltas tensor (<a class="el" href="structailayer.html#a6e0cd193754d9614d5da823f0f0fcbf6" title="The result of the backward function is stored here.">ailayer.deltas</a>; output of the backward function) to the given shift and zero_point = 0.<br  />
Use this function when you train a model in Q31 data-type.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
    <tr><td class="paramname">shift</td><td>Number of decimal places (shift in Q31) of the layer deltas </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a436e4f31e3a5498d033917db8277ff55"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a436e4f31e3a5498d033917db8277ff55">&#9670;&nbsp;</a></span>aialgo_set_model_gradient_precision_q31()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aialgo_set_model_gradient_precision_q31 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>shift</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the quantization parameters of the gradients for <a class="el" href="aimath__q31_8h.html">Q31 </a> data type. </p>
<p>Initializes the quantization parameters of the gradients tensors to the given shift and zero_point = 0.<br  />
Use this function when you train a model in Q31 data-type.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
    <tr><td class="paramname">shift</td><td>Number of decimal places (shift in Q31) of the gradients </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a0b1aae54861650b0d6e80fc638a0b0ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b1aae54861650b0d6e80fc638a0b0ea">&#9670;&nbsp;</a></span>aialgo_set_model_result_precision_q31()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aialgo_set_model_result_precision_q31 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>shift</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the quantization parameters of the layer results for <a class="el" href="aimath__q31_8h.html">Q31 </a> data type. </p>
<p>Initializes the quantization parameters of the layer output (<a class="el" href="structailayer.html#a1ed86d1fec7aae68bc79c55f3f965790" title="The result of the forward function is stored here.">ailayer.result</a>; output of the forward function) to the given shift and zero_point = 0.<br  />
Use this function for example when you train a model in Q31 data-type.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
    <tr><td class="paramname">shift</td><td>Number of decimal places (shift in Q31) of the layer results </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a46374a6a778c3fdeb43e7f32c7f5a2a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a46374a6a778c3fdeb43e7f32c7f5a2a5">&#9670;&nbsp;</a></span>aialgo_set_trainable_model()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aialgo_set_trainable_model </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Freeze / Unfreeze trainable parameters of the model. </p>
<p>When a layer is set to trainable = FALSE, the corresponding parameters are not modified by <a class="el" href="aialgo__sequential__training_8h.html#a6557fccf302f653bcdcb77830463d14d" title="Perform one training epoch on all data batches of the dataset using backpropagation.">aialgo_train_model()</a>.</p>
<p>The setting value can be accessed with: </p><div class="fragment"><div class="line"><span class="keywordflow">if</span>(AILAYER_SETTINGS_IS(layer-&gt;settings, 0b1, AILAYER_SETTINGS_TRAINABLE)){</div>
<div class="line">  ...</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
    <tr><td class="paramname">value</td><td>Target value (TRUE or FALSE) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a2d3943ef443b70a282c8af18b1155a2c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2d3943ef443b70a282c8af18b1155a2c">&#9670;&nbsp;</a></span>aialgo_set_training_mode_model()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void aialgo_set_training_mode_model </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables / disables the training mode of the model. </p>
<p>Some layers may behave differently during training than during inference (e.g. the Batch Normalization layer).<br  />
The <a class="el" href="aialgo__sequential__training_8h.html#a6557fccf302f653bcdcb77830463d14d" title="Perform one training epoch on all data batches of the dataset using backpropagation.">aialgo_train_model()</a> function calls this function internally.</p>
<p>The setting value can be accessed with: </p><div class="fragment"><div class="line"><span class="keywordflow">if</span>(AILAYER_SETTINGS_IS(layer-&gt;settings, 0b1, AILAYER_SETTINGS_TRAINING_MODE)){</div>
<div class="line">  ...</div>
<div class="line">}</div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
    <tr><td class="paramname">value</td><td>Target value (TRUE or FALSE) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a877ce6eee19a9f9bcbdb115d83537e68"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a877ce6eee19a9f9bcbdb115d83537e68">&#9670;&nbsp;</a></span>aialgo_sizeof_inference_memory()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t aialgo_sizeof_inference_memory </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate the memory requirements for intermediate results of an inference. </p>
<p>This memory is mainly for the result buffers of the layers.</p>
<p>Use <a class="el" href="aialgo__sequential__inference_8h.html#a7cbfac6a46c02107d19af7c8f6e5469a" title="Assign the memory for intermediate results of an inference to the model.">aialgo_schedule_inference_memory()</a> to set the memory to the model.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Required memory size in bytes </dd></dl>

</div>
</div>
<a id="acdf3763b8fe9047446ddbcfdbdae5570"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acdf3763b8fe9047446ddbcfdbdae5570">&#9670;&nbsp;</a></span>aialgo_sizeof_parameter_memory()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t aialgo_sizeof_parameter_memory </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaimodel.html">aimodel_t</a> *&#160;</td>
          <td class="paramname"><em>model</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate the memory requirements for the trainable parameters (like weights, bias, ...) of the model. </p>
<p>Use <a class="el" href="aialgo__sequential__inference_8h.html#a26db68cb4231b534b03c649d6eeab3f8" title="Assign the memory for the trainable parameters (like weights, bias, ...) of the model.">aialgo_distribute_parameter_memory()</a> to set the memory to the model.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*model</td><td>The model </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Required memory size in bytes </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_1e5d3661ed79af157d57e64a38265d09.html">basic</a></li><li class="navelem"><a class="el" href="dir_90008ee2b0f86999412b56217da88d54.html">base</a></li><li class="navelem"><a class="el" href="dir_bd8ee926357880309e83f96383a42e12.html">aialgo</a></li><li class="navelem"><a class="el" href="aialgo__sequential__inference_8h.html">aialgo_sequential_inference.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
